<?php
/**
 * Reset password form.
 * 
 * @package disputeo
 * @version 1.0
 * @author jimmy.dixon
 */

class Application_Form_Password extends Application_Form_Register
{
    /**
     * @var string 
     */
    protected $_legend = 'Enter a new password for your account.';

    /**
     * Add form elements
     */
    public function init()
    {
        $this->setName('password');
        $this->setAction('/login/password');
        $this->_addPasswordElement();
        $this->_addReTypePasswordElement();
        $this->_setDisplayGroup();
        $this->_addDisplayGroup('passwordGroup', $this->_legend);
        $this->_addSubmitElement('Submit');
        $this->_addPasswordValidators();
        
        $this->addElement('hash', 'csrf');
        $this->getElement('password')
            ->setAttrib('renderPassword', false);
        $this->getElement('password2')
            ->setAttrib('renderPassword', false);
    }
    
    /**
     * Set hidden input reset hash
     */
    public function addResetId($resetId = null)
    {
        $this->addElement('hidden', 'resetid');
        $this->getElement('resetid')->setValue($resetId);
    }

}